package com.braveman.im.ui.adapter;


import android.widget.ImageView;

import com.braveman.im.R;
import com.braveman.im.bean.DataSearchBean;
import com.braveman.im.bean.GroupListBean;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseSectionQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.qmuiteam.qmui.widget.QMUIRadiusImageView;

import java.util.List;

public class MineGroupAdapter extends BaseSectionQuickAdapter<GroupListBean, BaseViewHolder> {
    private QMUIRadiusImageView avater;
    public MineGroupAdapter(int layoutResId, int sectionHeadResId, List data) {
        super(layoutResId, sectionHeadResId, data);
    }

    @Override
    protected void convertHead(BaseViewHolder helper, final GroupListBean item) {
        helper.setText(R.id.tv_item_home_head, item.header + " (" + item.count + ")");
    }


    @Override
    protected void convert(BaseViewHolder helper, GroupListBean item) {
        helper.setText(R.id.name, item.groupName);
        avater = helper.getView(R.id.avatar);
        avater.setCircle(false);
        Glide.with(mContext).load(item.groupIcon).into(avater);
    }


}
